package ${basepackage}.framework.base.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Transactional;

import ${basepackage}.framework.base.dao.EntityDao;
import ${basepackage}.framework.base.page.BaseQuery;
import ${basepackage}.framework.base.page.Page;

<#include "/author.include">
public interface BaseService <E,PK extends Serializable>{


	public EntityDao getEntityDao();

	public E getById(PK id) throws DataAccessException;
	
	@Transactional(readOnly=true)
	public List<E> findAll() throws DataAccessException;
	
	@Transactional(readOnly=true)
	public List<E> findByProperty(String property,Object value) throws DataAccessException;
	
	public void saveOrUpdate(E entity) throws DataAccessException;
	

	public void save(E entity) throws DataAccessException;
	
	public void removeById(PK id) throws DataAccessException;
	
	public void update(E entity) throws DataAccessException;
	
	public boolean isUnique(E entity, String uniquePropertyNames) throws DataAccessException;
	
	public Page findPage(BaseQuery query);
	
}